package com.shenzhen.horselive.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.shenzhen.horselive.R;
import com.shenzhen.horselive.beans.AddressBean;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class AddrListAdpter extends BaseQuickAdapter<AddressBean, BaseViewHolder> {
    public AddrListAdpter(int layoutResId, @Nullable List<AddressBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, AddressBean s) {
        baseViewHolder.setText(R.id.tv_name, s.getContactsName())
                .setText(R.id.tv_phone, s.getContactsPhone())
                .setText(R.id.tv_content, s.getProvince() + s.getCity() + s.getCounty() + s.getAddress());
        if ("1".equals(s.getDef())) {
          baseViewHolder.setVisible(R.id.tv_state,true);
        } else
        {
            baseViewHolder.setVisible(R.id.tv_state,false);
        }


    }
}
